#ifndef SPLINECURVES_H
#define SPLINECURVES_H

#include <QtGlobal>
#include <QPointF>
#include <QVector>
#include <QPainter>

class Splinecurves
{
public:
    Splinecurves();
    ~Splinecurves();

    void drawSpline(QPainter &painter);

    void addCtrlPoint(QPointF qCtrlPoint);
    void clearCtrlPoint();

private:
    qreal N(int k, int i, qreal u);

    qreal N1(int i, qreal u);
    qreal N2(int i, qreal u);
    qreal N3(int i, qreal u);

private:
    QVector<QPointF>    m_ctrlPoints;       // 控制点
    QVector<QPointF>    m_curvePoints;      // 曲线上的点
};

#endif // SPLINECURVES_H
